import { defineStore } from "pinia";

export const homePinia=defineStore({
    id:"home",
    state(){
        return {
            isCollapse:false, //是否收缩导航栏
            width:14.286 //导航栏展开宽度
        }
    },
    getters:{
        getIsCollapse(){
            return this.isCollapse;
        },
        getWidth(){
            return this.width;
        }
    },
    actions:{
        setIsCollapse(isCollapse){
            this.isCollapse=isCollapse;
        },
        setWidth(width){
            this.width=width;
        }
    },
    persist:{
        enabled:true, //开启持久化存储
        strategies:[
            {
                key:"home",
                storage:localStorage
            }
        ]
    }
});
